﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Infrastructure;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// 易仓头程入库信息
    /// </summary>
    /// 

    public class EC_ReceivingDTO
    {
        public string code { get; set; }
        public string message { get; set; }
        public string requestId { get; set; }
        public long? timestamp { get; set; }
        public string version { get; set; }
        public string nonce_str { get; set; }
        public string sign_type { get; set; }
        public string sign { get; set; }
        public string biz_content { get; set; }

    }


    public class EC_Receiving_Data
    {
        public string total { get; set; }
        public int page { get; set; }
        public int page_size { get; set; }
        public List<EC_Receiving> data { get; set; }
    }

    public class EC_Receiving
    {
        public string ID { get; set; }
        public string RowId { get; set; }


        /// <summary>
        /// 入库单号
        /// </summary>
        public string receiving_code { get; set; }

        /// <summary>
        /// 客户参考号
        /// </summary>
        public string reference_no { get; set; }
        /// <summary>
        /// 采购单号
        /// </summary>
        public string po_code { get; set; }
        /// <summary>
        /// 仓库Id
        /// </summary>
        public string warehouse_id { get; set; }
        /// <summary>
        /// 跟踪号
        /// </summary>
        public string tracking_number { get; set; }
        /// <summary>
        /// 目的仓库Id
        /// </summary>
        public string to_warehouse_id { get; set; }
        /// <summary>
        /// 客户代码
        /// </summary>
        public string customer_code { get; set; }

        /// <summary>
        /// 收货状态	
        /// </summary>
        private string _receiving_type;
        public string receiving_type
        {
            get { return _receiving_type; }

            set
            {
                if (value == "0") _receiving_type = "标准";
                else if (value == "1") _receiving_type = "订单退货";
                else if (value == "2") _receiving_type = "指定产品退件";
                else if (value == "3") _receiving_type = "中转";
                else if (value == "4") _receiving_type = "采购";
                else if (value == "5") _receiving_type = "其它";
                else if (value == "6") _receiving_type = "借用归还入库";
                else if (value == "7") _receiving_type = "初始化库存";
                else if (value == "8") _receiving_type = "不良品入库";
                else if (value == "9") _receiving_type = "盘盈";
                else if (value == "10") _receiving_type = "调拨";
                else if (value == "11") _receiving_type = "换货";
                else if (value == "12") _receiving_type = "同步服务商库存";
                else if (value == "13") _receiving_type = "出库单入库";
                else if (value == "14") _receiving_type = "同步添加库存";
                else if (value == "15") _receiving_type = "赠品入库";
                else _receiving_type = value;
            }
        }

        /// <summary>
        /// 中转状态	
        /// </summary>
        private string _receiving_transfer_status;
        public string receiving_transfer_status
        {
            get { return _receiving_transfer_status; }

            set
            {
                if (value == "0") _receiving_transfer_status = "草稿";
                else if (value == "1") _receiving_transfer_status = "待处理";
                else if (value == "2") _receiving_transfer_status = "处理中";
                else if (value == "3") _receiving_transfer_status = "处理完成";
                else _receiving_transfer_status = value;
            }
        }

        /// <summary>
        /// 入库单状态	
        /// </summary>
        private string _receiving_status;
        public string receiving_status
        {
            get { return _receiving_status; }

            set
            {
                if (value == "0") _receiving_status = "删除";
                else if (value == "1") _receiving_status = "草稿";
                else if (value == "2") _receiving_status = "确认";
                else if (value == "3") _receiving_status = "待审核";
                else if (value == "4") _receiving_status = "审核";
                else if (value == "5") _receiving_status = "在途";
                else if (value == "6") _receiving_status = "收货中";
                else if (value == "7") _receiving_status = "收货完成";
                else _receiving_status = value;
            }
        }

        /// <summary>
        /// 备注
        /// </summary>
        public string receiving_description { get; set; }

        /// <summary>
        /// 退件单号。 入库类型（receiving_type）为：1时返回
        /// </summary>
        public List<string> rma_code { get; set; }

        public string rma_code_s { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public string receiving_add_time { get; set; }
        /// <summary>
        /// 更新时间（操作收货/质检/上架时，将更新此时间）
        /// </summary>
        public string receiving_update_time { get; set; }
        /// <summary>
        /// 入库单Id
        /// </summary>
        public string receiving_id { get; set; }
        /// <summary>
        /// 预计到达时间
        /// </summary>
        public string expected_date { get; set; }
        /// <summary>
        /// 仓库
        /// </summary>
        public string warehouse { get; set; }
        /// <summary>
        /// 处理收货异常
        /// </summary>
        public string receiving_ex_status { get; set; }
        /// <summary>
        /// 采购成本
        /// </summary>
        public string purchase_cost { get; set; }
        /// <summary>
        /// 头程成本
        /// </summary>
        public string transfer_shipping_fee { get; set; }
        /// <summary>
        /// 币种
        /// </summary>
        public string currency_code { get; set; }
        /// <summary>
        /// 收货完成时间
        /// </summary>
        public string complete_time { get; set; }
        /// <summary>
        /// 产品信息
        /// </summary>
        public List<Product_Info> product_info { get; set; }
        public class Product_Info
        {
            /// <summary>
            /// 产品代码
            /// </summary>
            public string product_barcode { get; set; }
            /// <summary>
            /// 产品名称
            /// </summary>
            public string product_title { get; set; }
            /// <summary>
            /// 中转状态	
            /// </summary>
            private string _rd_status;
            public string rd_status
            {
                get { return _rd_status; }

                set
                {
                    if (value == "0") _rd_status = "在途";
                    else if (value == "1") _rd_status = "处理中";
                    else if (value == "2") _rd_status = "收货完成";
                    else _rd_status = value;
                }
            }

            /// <summary>
            /// 状态名称
            /// </summary>
            public string rd_status_string { get; set; }
            /// <summary>
            /// 送货数量
            /// </summary>
            public string rd_receiving_qty { get; set; }
            /// <summary>
            /// 收货数量
            /// </summary>
            public string rd_received_qty { get; set; }
            /// <summary>
            /// 收货数量差异
            /// </summary>
            public string dif_receive_num { get; set; }
            /// <summary>
            /// 上架数量
            /// </summary>
            public string rd_putaway_qty { get; set; }
            /// <summary>
            /// 是否质检
            /// </summary>
            public string is_qc { get; set; }
            /// <summary>
            /// 优先处理
            /// </summary>
            public string is_priority { get; set; }
            /// <summary>
            /// 更新时间
            /// </summary>
            public string rd_update_time { get; set; }
            /// <summary>
            /// 备注
            /// </summary>
            public string rd_note { get; set; }
            /// <summary>
            /// 批次号（自定义批次）beta(待上线）
            /// </summary>
            public object custom_number { get; set; }

            /// <summary>
            /// 序列号 beta (待上线）
            /// </summary>
            public object serial_no_list { get; set; }
        }

        /// <summary>
        /// 产品代码
        /// </summary>
        public string product_info_product_barcode { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string product_info_product_title { get; set; }
        /// <summary>
        /// 中转状态	
        /// </summary>
        public string product_info_rd_status { get; set; }
        /// <summary>
        /// 状态名称
        /// </summary>
        public string product_info_rd_status_string { get; set; }
        /// <summary>
        /// 送货数量
        /// </summary>
        public string product_info_rd_receiving_qty { get; set; }
        /// <summary>
        /// 收货数量
        /// </summary>
        public string product_info_rd_received_qty { get; set; }
        /// <summary>
        /// 收货数量差异
        /// </summary>
        public string product_info_dif_receive_num { get; set; }
        /// <summary>
        /// 上架数量
        /// </summary>
        public string product_info_rd_putaway_qty { get; set; }
        /// <summary>
        /// 是否质检
        /// </summary>
        public string product_info_is_qc { get; set; }
        /// <summary>
        /// 优先处理
        /// </summary>
        public string product_info_is_priority { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public string product_info_rd_update_time { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string product_info_rd_note { get; set; }
        


    }
}
